(1) Field of the Invention
The present invention relates to an image coding apparatus which compression-codes images and records the compression-coded images on storage media such as optical discs, magnetic disks, and flash memories and others, and an image coding method. More particularly, the present invention relates to an image coding apparatus which performs the compression-coding in the MPEG-4 AVC/H.264 compression-coding standard, an image coding method, an image coding integrated circuit, and a camera.
(2) Description of the Related Art
Along with the progress in the digital video technology, there has been progress in techniques for compression-coding the digital video data in response to the increasing the data amount. The compression-coding technology specialized for the video data making use of the video data shows the progress.
Furthermore, improvement in the processing capacity of the information processing devices such as computers allows complex computations for the compression-coding techniques, which has significantly been raising the compression rate of video data. More specifically, the compression-coding technique adopted for the satellite and terrestrial digital high-definition broadcast is called the Moving Picture Experts Group 2 (MPEG-2). For example, in the satellite digital high-definition digital broadcast, the video data is compressed to approximately 1/30 using the MPEG-2.
The MPEG-4 AVC/H.264 (hereinafter referred to as the H.264) which is one of the video compression-coding standards standardized after the MPEG-2 is considered to achieve a compression rate approximately twice higher than that of the MPEG-2. The H.264 has also been adopted as a moving picture compression-coding method for the Blu-ray, one of the standards for optical discs, and for the Advanced Video Codec High Definition (AVCHD) which is a standard for recording high-definition video by a video camera, and is expected to be used in a wide range of fields.
However, as disclosed in Non-patent Reference 1 (ITU-T Recommendation H.264), the H.264 achieves high compression rate by implementing many compression-coding techniques and combining the techniques. Accordingly, the computation amount significantly increases compared to that of the MPEG-2 as well.
In general, in the compression-coding of a moving picture, the amount of information is compressed by reducing redundancy in temporal and spatial directions. More specifically, in inter prediction coding which aims for reducing temporal redundancy, a preceding or following picture is referred to in order to estimate motion (motion vector estimation) and to generate a predicted image (motion compensation) per block. Subsequently, a difference value between the generated predicted image and a current picture to be coded is coded.
Another compression-coding technique for compressing the moving picture is a weighted prediction. In the motion compensation with the weighted prediction, the pixel value of the reference picture “pred” is multiplied by the weighting value “w”, and the offset value “o” is added. Accordingly, the predicted pixel value “p” is “w×pred+o”. On the other hand, in the motion compensation without the weighted prediction, the predicted pixel value “p” is the pixel value of the reference picture “pred”.
Accordingly, in the weighted prediction, brightness of the image can be predicted using the weighting value “w” and the offset value “o”. In other words, a highly precise predicted image can be generated by predicting the change in the brightness of the image and determining the weighting value “w” and the offset value “o” based on the predicted change in the brightness of the image. Therefore, it is possible to improve the coding efficiency for coding fading video and live video which includes frequent flashing.
Note that the weighted prediction has two modes, i.e., the Implicit mode and the Explicit mode. When the motion compensation using the Implicit mode is selected, the weighting value “w” and the offset value “o” are calculated using the calculation method specified by the standard. When the motion compensation using the Explicit mode is selected, the encoder which performs compression-coding perform the coding with the weighting value “w” and the offset value “o” on the stream header of the coded stream. Thus, it is possible to specify the weighting value “w” and the offset value “o” within the acceptable range specified by the standard.
For example, Patent Reference 1 (Japanese Unexamined Patent Application Publication No. 2007-306619) discloses a technique for determining whether or not the weighted prediction is performed by determining whether or not the moving picture to be coded is a fading moving picture. More specifically, it is determined whether the moving picture to be coded is a fading moving picture or not by detecting a change in the luminance value of the image.
This allows switching between applying the weighted prediction and not applying the weighted prediction, and thereby the coding efficiency can be improved more effectively.